var islog=false;



var gk=10;
function agk(){
  gk++;
  alert(gk)
}

function gurl(_str){
  window.location.href=_str
}

var gindex=1;
var arr=[1,1,1,1];


gurl('#/app');

angular.module('starter.controllers', [])




.service('ss',function(){

  this.s1=function(){
    // alert(99)
  }

})


.controller('zhucec', function($scope) {
    
})


.controller('haikuangcc', function($scope) {
    $scope.$on('$ionicView.enter', function() {
      // alert(8877)

    })


    
    $scope.haikuangmingxi=function(){
        // alert(gindex)
        if(gindex==1){
          gurl('#/app/tabs/haikuangmingxi')
          return
        }
        if(gindex==2){
          gurl('#/app/tabs/haikuangmingxi2')
          return
        }
    }

    $scope.haikuang=function(){
        // alert(gindex)
        // return
        if(gindex==1){
          gurl('#/app/tabs/home_jilu')
          return
        }
        if(gindex==2){
          gurl('#/app/tabs/account_jilu')
          return
        }
    }


})


.controller('tabsc',function($scope){
    var arr=[1,"#/app/tabs/home","#/app/tabs/account","#/app/tabs/discovery","#/tabs/my"]
    $scope.click=function(a1){
        gindex=a1;
        var url=arr[a1];
        gurl(url);
    }

    // gurl('#/tabs/home');
    // alert(999)

})



.controller('home_haikuanjilucc', function($scope) {
    // alert(999)
    $scope.click=function(ss){
      $('#home1').removeClass('active')
      $('#home2').removeClass('active')
      $(ss).addClass('active')

    }
})


.controller('homec', function($scope,ss,$timeout) {
    
    
    $scope.$on('$ionicView.enter', function() {

      $('.hhh').removeClass('tabss-item-hide');
      // $scope.aa.cc='tabss-item-hide'
      // agk()
      ss.s1()
      // alert(999)

      //TweenLite.from($('.window'),1,{alpha:0})
    })


    $scope.dd={
      aa:'ffffdsfds98',
      bb:99
    }

    $scope.doRefresh=function () {
      $timeout(function () {
        $scope.$broadcast('scroll.refreshComplete');
      }, 1000);
    }


    $scope.haikuang=function(){
      
      window.location.href='#/app/tabs/haikuang'
      // #/tabs/my
    }



  // $('.hhh').removeClass('tabss-item-hide');

})

.controller('home_jiekuangc', function($scope) {

})


.controller('haikuangc', function($scope) {

   $scope.dd={

      aa:6,
    }
    //$('.hhh').addClass('tabss-item-hide');

    // removeClass
    $scope.$on('$ionicView.enter', function() {

      $('.hhh').addClass('tabss-item-hide');
        //setTimeout($scope.hh, 500 )
        // agk()
    });

    $scope.hh=function(){
     // alert(99)
      $scope.dd.aa+=35
    }
    // setTimeout(function(){}, 3000 )
    

})


.controller('accountc', function($scope) {

  //$('.hhh').removeClass('tabss-item-hide');
  $scope.$on('$ionicView.enter', function() {

      $('.hhh').removeClass('tabss-item-hide');
      // agk()
    });
})

.controller('discoveryc', function($scope) {
 $scope.$on('$ionicView.enter', function() {

      $('.hhh').removeClass('tabss-item-hide');
    });
  $scope.settings = {
    enableFriends: true
  };
})

.controller('myc', function($scope) {
  $scope.$on('$ionicView.enter', function() {

      $('.hhh').removeClass('tabss-item-hide');
      // agk()
    });
  $scope.homeclick=function(){
    window.location.href='#/app/tabs/home'
  }

});


// <html ng-app='myApp'><head><title>ng-show实例</title></head><body ng-controller='ShowController'><button ng-click="toggleMenu()">Toggle Menu</button><ul ng-show='menuState.show'><li>Stun</li><li>Disintegrate</li><li>Erase from history</li></ul><script src="lib/angular/angular.js"></script><script>var myApp=angular.module('myApp',[])  myApp.controller('ShowController', function($scope) {$scope.menuState={show: false}$scope.toggleMenu=function() {$scope.menuState.show=!$scope.menuState.show;}});</script></body></html>